package cn.lili.modules.promotion.client;

import cn.lili.modules.constant.ServiceConstant;
import cn.lili.modules.promotion.entity.BlindboxRelVO;
import cn.lili.modules.promotion.entity.dos.BlindboxRuleOrder;
import cn.lili.modules.promotion.fallback.BlindboxRelFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author xiangqian
 * @Date 2023/10/6 14:58
 */
@FeignClient(path = "${server.servlet.context-path}", name = ServiceConstant.PROMOTION_SERVICE, contextId = "blindbox-rel", fallback = BlindboxRelFallback.class)
public interface BlindboxRelClient {

    /**
     * 添加盲盒规则商品关联
     * */
    @PostMapping("/feign/promotion/blindbox/rel")
    Boolean addBlindboxRel(@RequestBody @Validated BlindboxRelVO blindboxRelVO);

    /**
     * 获取ID
     * @param ids 商品ID
     * @return 订单
     */
    @GetMapping("/getOrderByGoodsIds")
    List<BlindboxRuleOrder> getOrderByGoodsIds(@RequestParam String ids);
}
